Skip to content

Conversation

@fzowl
Copy link
Contributor

@fzowl fzowl commented Oct 13, 2025

Description of changes

Voyageai contextual and multimodal
Adding token counting
Adding more tests

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Migration plan

Are there any migrations, or any forwards/backwards compatibility changes needed in order to make sure this change deploys reliably?
No

Observability plan

What is the plan to instrument and monitor this change?

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs section?

@github-actions
Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@propel-code-bot
Copy link
Contributor

propel-code-bot bot commented Oct 13, 2025

Add VoyageAI contextual, multimodal, token-counting & batching support

This PR substantially extends the VoyageAI integration. The original VoyageAIEmbeddingFunction has been refactored to support three model families (standard, contextual, multimodal), automatic token-limit aware batching, explicit batch-size caps, token-count utilities, and mixed-media (text+image) conversion through Pillow.
The update removes the implicit default model name, requires callers to pass model_name, introduces a Pillow runtime dependency, adds ~350 new unit tests covering new code paths, and rewrites the public docs with detailed usage examples for text, contextual, multimodal, and token-counting scenarios.

Key Changes

• Refactor chromadb/utils/embedding_functions/voyageai_embedding_function.py:
• new parameters: model_name (now required), dimensions, embedding_type, batch_size.
• supports multimodal (multimodal_embed) and contextual (contextualized_embed) APIs.
• unified _embed_with_batching() with token-aware batching using single tokenize() call.
• adds count_tokens(), get_token_limit(), _is_context_model(), _is_multimodal_model(), and image convert() logic via PIL.
• exposes full config in get_config() and builder.
• Test suite expansion: chromadb/test/ef/test_voyageai_ef.py (+300 lines) and new test_voyage_multimodal.py (+150 lines) covering dimensions, multimodal text/images, batching, token limits, config round-trip.
• Documentation overhaul in docs/.../voyageai.md to reflect new models, parameters, multimodal & contextual examples, and token-counting guidance.
• Token-limit constants (VOYAGE_TOTAL_TOKEN_LIMITS) covering 17 VoyageAI models.
• Drop default model_name; callers must now specify model, making the change breaking for previous implicit usage.

Affected Areas

chromadb/utils/embedding_functions/voyageai_embedding_function.py
• Unit-tests under chromadb/test/ef/
• User documentation for VoyageAI integration

This summary was automatically generated by @propel-code-bot

Adding token counting and flexible batch size
Extending the tests
Co-authored-by: propel-code-bot[bot] <203372662+propel-code-bot[bot]@users.noreply.github.com>
@fzowl
Copy link
Contributor Author

fzowl commented Oct 27, 2025

I removed the default model. I'm aware that this might cause problems, but i think it would be better if the user passes the model name intentionally to avoid any issue.

@fzowl fzowl changed the title Voyageai integration update [Enh] Voyageai integration update Oct 27, 2025
@fzowl fzowl changed the title [Enh] Voyageai integration update [ENH] Voyageai integration update Oct 27, 2025
@fzowl
Copy link
Contributor Author

fzowl commented Oct 27, 2025

@tazarov, can you please take a look? How to push this PR forward?

@fzowl
Copy link
Contributor Author

fzowl commented Nov 13, 2025

@tazarov, can you please take a look? How would you like to push this PR forward?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant